package com.learn.springcloud.config;

import com.learn.springcloud.ribboncodingconfigconsumer.annotation.ExcludeComponent;
import com.netflix.client.DefaultLoadBalancerRetryHandler;
import com.netflix.client.RetryHandler;
import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.*;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.netflix.ribbon.DefaultServerIntrospector;
import org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerContext;
import org.springframework.cloud.netflix.ribbon.ServerIntrospector;
import org.springframework.cloud.netflix.ribbon.ZonePreferenceServerListFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author unixman
 * @time : 2018/7/24 16:41
 * @version : 1.0
 */
@Configuration
@ExcludeComponent
public class ConsumerRibbonClientConfiguration1{

    /**
     * 自定义路由规则：随机规则
     * @return IRule
     */
    @Bean
    public IRule ribbonRule() {
        return new RandomRule();
    }

}
